https://glot.io/snippets/gijfj3htxk/raw/main.lua